#!/bin/bash

version=$(cat ./version.txt)
let version+=1

echo $version > ./version.txt


git add .

is_change=0
temFile="temFile"
git status > $temFile
while read aline
do
echo $aline
        if [ "$aline" = "Changes to be committed:" ]
#       if [ "$aline" = "Untracked files:" ]
        then
                is_change=1
        fi
done < $temFile

if [ $is_change -eq 1 ]
then
        git commit -m "自动更新"
                git push
fi
